<template>
  <div class="app-container">
    <el-descriptions title="汇总表格" direction="vertical" :column="modules.length" border>
      <el-descriptions-item v-for="(module,index) in modules" :label="module.modTitle">
        <el-link @click="change(module,index)">{{ module.files }}</el-link>
      </el-descriptions-item>
    </el-descriptions>


    <!-- $t is vue-i18n global function to translate lang -->
    <el-input v-model="filename" style="width:350px;" prefix-icon="el-icon-document"/>
    <el-button :loading="downloadLoading" style="margin-bottom:20px" type="primary" icon="el-icon-document"
               @click="handleDownload">
      <!--      {{ $t('excel.selectedExport') }}-->
      导出表格
    </el-button>


    <el-table
        ref="multipleTable"
        v-loading="listLoading"
        element-loading-text="拼命加载中"
        border
        fit
        height="480"
        highlight-current-row
        @selection-change="handleSelectionChange"
        :data="list">
      <el-table-column type="selection" align="center"/>
      <el-table-column
          label=""
          type="index"
          fixed
          width="50">
      </el-table-column>
      <el-table-column wideth="auto" v-for="module in headers" :label="module.cn" :prop="module.en" :key="module.cn">
        <!--        <el-link>{{ module.count }}</el-link>-->
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

import Request from "@/api/request";
import {query} from "@/api/docMG";

export default {
  name: 'SelectExcel',
  mounted() {
    this.listLoading = true
    this.headers = this.headerlist[0]
    Request.get("/model/modules").then(res => {
      console.log(res)
      this.modules = res.data
      this.modules.pop()
      query(1, 10, 0, this.modules[0].modDbTable, this.view_order).then(res => {
        this.list = res.data.docs.records
      })
      this.listLoading = false
    })

  },

  data() {
    return {
      view_order: "time:asc",
      modules: [],
      list: [],
      listLoading: false,
      multipleSelection: [],
      downloadLoading: false,
      filename: '',
      headers: [],
      headerlist: [

        [
          {
            "cn": "论文名",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "刊物名称",
            "en": "jurnal",
            "is_table_view": "1",
            "item_type": "text",
            "values": ""
          },
          // {
          //   "cn": "收录检索",
          //   "en": "jurnal_lever",
          //   "is_table_view": "0",
          //   "item_type": "checkbox",
          //   "values": "[{\"val\":\"SCI\",\"txt\":\"SCI\",\"weight\":\"1\"},{\"val\":\"SCIE\",\"txt\":\"SCIE\",\"weight\":\"2\"},{\"val\":\"SSCI\",\"txt\":\"SSCI\",\"weight\":\"3\"},\r\n{\"val\":\"ESCI\",\"txt\":\"ESCI\",\"weight\":\"3\"},{\"val\":\"自然指数杂志\",\"txt\":\"自然指数杂志\",\"weight\":\"3\"},\r\n{\"val\":\"CSSCI\",\"txt\":\"CSSCI\",\"weight\":\"4\"},{\"val\":\"CSSCI扩展版\",\"txt\":\"CSSCI扩展版\",\"weight\":\"5\"},{\"val\":\"CSCD\",\"txt\":\"CSCD-C\",\"weight\":\"6\"},{\"val\":\"CSCD-E\",\"txt\":\"CSCD-E\",\"weight\":\"7\"},{\"val\":\"SCD\",\"txt\":\"SCD\",\"weight\":\"7\"},{\"val\":\"AHCI\",\"txt\":\"AHCI\",\"weight\":\"8\"},{\"val\":\"EI\",\"txt\":\"EI\",\"weight\":\"9\"},{\"val\":\"ISTP\",\"txt\":\"CPCI-S(ISTP)\",\"weight\":\"10\"},{\"val\":\"ISSHP\",\"txt\":\"CPCI-SSH(ISSHP)\",\"weight\":\"11\"},{\"val\":\"PKU(中文核心)\",\"txt\":\"PKU(中文核心)\",\"weight\":\"12\"},{\"val\":\"科研核心\",\"txt\":\"科技核心\",\"weight\":\"14\"},{\"val\":\"国家级期刊\",\"txt\":\"国家级期刊\",\"weight\":\"15\"},{\"val\":\"省级期刊\",\"txt\":\"省级期刊\",\"weight\":\"16\"},{\"val\":\"校内核心\",\"txt\":\"校内核心\",\"weight\":\"17\"},{\"val\":\"会议期刊\",\"txt\":\"会议论文\",\"weight\":\"18\"},{\"val\":\"其他\",\"txt\":\"其他\",\"weight\":\"19\"}]"
          // },
          {
            "cn": "发表时间",
            "en": "jurnalPuttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "卷号",
            "en": "batch",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "起止页码",
            "en": "pageIndex",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"0\",\"txt\":\"无\"},{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"11\",\"txt\":\"11\"},{\"val\":\"12\",\"txt\":\"12\"},{\"val\":\"13\",\"txt\":\"13\"},{\"val\":\"14\",\"txt\":\"14\"},{\"val\":\"15\",\"txt\":\"15\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "通讯作者",
            "en": "corAuthor",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"是\",\"txt\":\"是\"},{\"val\":\"否\",\"txt\":\"否\"}]"
          },
          {
            "cn": "影响因子",
            "en": "impactFactor",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "ISSN号",
            "en": "issn",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          // {
          //   "cn": "国际JCR分区",
          //   "en": "sciInterJcr",
          //   "is_table_view": "0",
          //   "item_type": "select",
          //   "values": "[{\"val\":\"\",\"txt\":\"请选择分区\"},{\"val\":\"JCR Q1\",\"txt\":\"JCR Q1\"},{\"val\":\"JCR Q2\",\"txt\":\"JCR Q2\"},{\"val\":\"JCR Q3\",\"txt\":\"JCR Q3\"},{\"val\":\"JCR Q4\",\"txt\":\"JCR Q4\"},{\"val\":\"无\",\"txt\":\"无\"}]"
          // },
          // {
          //   "cn": "中科院JCR分区",
          //   "en": "sciInterJcr",
          //   "is_table_view": "0",
          //   "item_type": "select",
          //   "values": "[{\"val\":\"\",\"txt\":\"请选择分区\"},{\"val\":\"一区\",\"txt\":\"一区TOP\"},{\"val\":\"一区非TOP\",\"txt\":\"一区非TOP\"},{\"val\":\"二区TOP\",\"txt\":\"二区TOP\"},{\"val\":\"二区\",\"txt\":\"二区非TOP\"},{\"val\":\"三区\",\"txt\":\"三区\"},{\"val\":\"四区\",\"txt\":\"四区\"},{\"val\":\"无\",\"txt\":\"无\"}]"
          // },
          // {
          //   "cn": "WOS入藏号",
          //   "en": "wos",
          //   "is_table_view": "0",
          //   "item_type": "text",
          //   "values": ""
          // },
          {
            "cn": "CN号",
            "en": "cn",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "DOI号",
            "en": "doi",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "引用次数",
            "en": "citations",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "论文类型",
            "en": "paperType",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"期刊论文\",\"txt\":\"期刊论文\"},{\"val\":\"会议论文集\",\"txt\":\"会议论文集\"},{\"val\":\"报纸\",\"txt\":\"报纸\"},{\"val\":\"学位论文\",\"txt\":\"学位论文\"}]"
          },
          {
            "cn": "自然指数杂志",
            "en": "natureIndexed",
            "is_table_view": "0",
            "item_type": "hidden",
            "values": "[{\"val\":\"否\",\"txt\":\"否\"},{\"val\":\"是\",\"txt\":\"是\"}]"
          },
          {
            "cn": "关键词",
            "en": "keywords",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "共同一作",
            "en": "commonFirst",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"否\",\"txt\":\"否\"},{\"val\":\"是\",\"txt\":\"是\"}]"
          },
          {
            "cn": "独著",
            "en": "writeAlone",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"否\",\"txt\":\"否\"},{\"val\":\"是\",\"txt\":\"是\"}]"
          },
          // {
          //   "cn": "ESI",
          //   "en": "esi",
          //   "is_table_view": "0",
          //   "item_type": "checkbox",
          //   "values": "[{\"val\":\"热点\",\"txt\":\"热点\"},{\"val\":\"高被引\",\"txt\":\"高被引\"},{\"val\":\"无\",\"txt\":\"无\"}]"
          // },
          {
            "cn": "摘要(Abstract)",
            "en": "abstract",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "期号",
            "en": "issue",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "论文领域",
            "en": "paperField",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"科研(社科)\",\"txt\":\"科研(社科)\"},{\"val\":\"科研(自科)\",\"txt\":\"科研(自科)\"},{\"val\":\"教育\",\"txt\":\"教育\"}]"
          }
        ],
        [
          {
            "cn": "著作名称",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"独著\",\"txt\":\"独著\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "身份",
            "en": "jurnalType",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"著作\",\"txt\":\"著作\",\"weight\":\"1\"},{\"val\":\"总主编\",\"txt\":\"总主编\",\"weight\":\"2\"},{\"val\":\"副主编\",\"txt\":\"副主编\",\"weight\":\"3\"},{\"val\":\"主编\",\"txt\":\"主编\",\"weight\":\"4\"},{\"val\":\"参编\",\"txt\":\"参编\",\"weight\":\"5\"},{\"val\":\"主审\",\"txt\":\"主审\",\"weight\":\"6\"},{\"val\":\"其他\",\"txt\":\"其他\",\"weight\":\"7\"}]"
          },
          {
            "cn": "出版社",
            "en": "press",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "著作类型",
            "en": "textbook",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"否\",\"txt\":\"非教材\"},{\"val\":\"普通\",\"txt\":\"普通教材\"},{\"val\":\"省级规划\",\"txt\":\"省级规划教材\"},{\"val\":\"国家级规划\",\"txt\":\"国家级规划教材\"}]"
          },
          {
            "cn": "出版时间",
            "en": "pubtime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "出版号",
            "en": "issnNo",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "出版地",
            "en": "pubLocation",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "字数(千字)",
            "en": "wordCount",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          }
        ],
        [
          {
            "cn": "荣誉名称",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "获奖名次",
            "en": "rank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"一等奖\",\"txt\":\"一等奖\"},{\"val\":\"二等奖\",\"txt\":\"二等奖\"},{\"val\":\"三等奖\",\"txt\":\"三等奖\"},{\"val\":\"金\",\"txt\":\"金\"},{\"val\":\"银\",\"txt\":\"银\"},{\"val\":\"铜\",\"txt\":\"铜\"},{\"val\":\"冠\",\"txt\":\"冠\"},{\"val\":\"亚\",\"txt\":\"亚\"},{\"val\":\"季\",\"txt\":\"季\"},{\"val\":\"特等奖\",\"txt\":\"特等奖\"},{\"val\":\"优秀奖\",\"txt\":\"优秀奖\"},{\"val\":\"入围奖\",\"txt\":\"入围奖\"},{\"val\":\"优秀指导教师奖\",\"txt\":\"优秀指导教师奖\"},{\"val\":\"优秀组织奖\",\"txt\":\"优秀组织奖\"},{\"val\":\"不计等次\",\"txt\":\"不计等次\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "级别\t",
            "en": "lever",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"国际级\",\"txt\":\"国际级\",\"weight\":\"1\"},{\"val\":\"国家级\",\"txt\":\"国家级\",\"weight\":\"1\"},{\"val\":\"省级\",\"txt\":\"省级\",\"weight\":\"2\"},{\"val\":\"市厅级\",\"txt\":\"市厅级\",\"weight\":\"3\"},{\"val\":\"校级\",\"txt\":\"校级\",\"weight\":\"4\"},{\"val\":\"其他\",\"txt\":\"其他\",\"weight\":\"5\"}]"
          },
          {
            "cn": "授予单位\t",
            "en": "organization",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "获奖时间",
            "en": "puttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          }
        ],
        [
          {
            "cn": "档案标题",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "获得时间",
            "en": "puttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "证书类型",
            "en": "certType",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"其它证书\",\"txt\":\"其它证书\"},{\"val\":\"学位证书\",\"txt\":\"学位证书\",\"title_options\":[\"博士学位证书\",\"硕士学位证书\",\"学士学位证书\"]},{\"val\":\"学历证书\",\"txt\":\"学历证书\",\"title_options\":[\"博士研究生学历证书\",\"硕士研究生学历证书\",\"本科学历证书\",\"专科及以下学历证书\"]},{\"val\":\"语言证书\",\"txt\":\"语言证书\",\"title_options\":[\"GRE\",\"托福证书\",\"雅思证书\",\"TEM-四级证书\",\"TEM-八级证书\",\"CET-四级证书\",\"CET-六级证书\",\"PETS证书\",\"普通话等级证书\",\"其他\"]},{\"val\":\"居民身份证\",\"txt\":\"居民身份证\",\"title\":\"居民身份证\"},{\"val\":\"教师资格证\",\"txt\":\"教师资格证\",\"title\":\"教师资格证\"}]"
          },
          {
            "cn": "证书编号",
            "en": "certNo",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "授予机构",
            "en": "certAuthorization",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          }
        ],
        [
          {
            "cn": "新闻事件",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "媒体级别",
            "en": "lever",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"国际级\",\"txt\":\"国际级\",\"weight\":\"1\"},{\"val\":\"国家级\",\"txt\":\"国家级\",\"weight\":\"2\"},{\"val\":\"省级\",\"txt\":\"省级\",\"weight\":\"3\"},{\"val\":\"市厅级\",\"txt\":\"市厅级\",\"weight\":\"4\"},{\"val\":\"其他\",\"txt\":\"其他\",\"weight\":\"5\"}]"
          },
          {
            "cn": "报道时间",
            "en": "times",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "栏目/版面",
            "en": "books",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "在线链接",
            "en": "links",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "媒体名称",
            "en": "mediaName",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          }
        ],
        [
          {
            "cn": "专利名称",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "专利类型",
            "en": "typeid",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"发明\",\"txt\":\"发明\"},{\"val\":\"实用新型\",\"txt\":\"实用新型\"},{\"val\":\"外型\",\"txt\":\"外观设计\"},{\"val\":\"国际专利\",\"txt\":\"国际专利\"}]"
          },
          {
            "cn": "专利编号",
            "en": "number",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "授权公告日",
            "en": "puttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "专利申请日",
            "en": "ctime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "申请编号",
            "en": "applyNumber",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "专利状态",
            "en": "status",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"已授权\",\"txt\":\"已授权\"},{\"val\":\"已受理\",\"txt\":\"已受理\"},{\"val\":\"已申请\",\"txt\":\"已申请\"}]"
          },
          {
            "cn": "专利权人",
            "en": "rightOwner",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          }
        ],
        [
          {
            "cn": "比赛名称",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "获奖名次",
            "en": "ranking",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"一等奖\",\"txt\":\"一等奖\"},{\"val\":\"二等奖\",\"txt\":\"二等奖\"},{\"val\":\"三等奖\",\"txt\":\"三等奖\"},{\"val\":\"金\",\"txt\":\"金\"},{\"val\":\"银\",\"txt\":\"银\"},{\"val\":\"铜\",\"txt\":\"铜\"},{\"val\":\"冠\",\"txt\":\"冠\"},{\"val\":\"亚\",\"txt\":\"亚\"},{\"val\":\"季\",\"txt\":\"季\"},{\"val\":\"特等奖\",\"txt\":\"特等奖\"},{\"val\":\"优秀奖\",\"txt\":\"优秀奖\"},{\"val\":\"入围奖\",\"txt\":\"入围奖\"},{\"val\":\"不计等次\",\"txt\":\"不计等次\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "级别",
            "en": "lever",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"国际级\",\"txt\":\"国际级\",\"weight\":\"1\"},{\"val\":\"国家级\",\"txt\":\"国家级\",\"weight\":\"1\"},{\"val\":\"省部级\",\"txt\":\"省部级\",\"weight\":\"2\"},{\"val\":\"市厅级\",\"txt\":\"市厅级\",\"weight\":\"3\"},{\"val\":\"校级\",\"txt\":\"校级\",\"weight\":\"4\"},{\"val\":\"其他\",\"txt\":\"其他\",\"weight\":\"5\"}]"
          },
          {
            "cn": "授予单位",
            "en": "school",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "获奖时间",
            "en": "times",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "获奖学生",
            "en": "students",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          }
        ],
        [
          {
            "cn": "材料标题",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "课时",
            "en": "period",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "评分/等级",
            "en": "lever",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "获得时间",
            "en": "puttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "培训单位",
            "en": "trainInstitution",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          }
        ],
        [
          {
            "cn": "课题名称",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "合同来源",
            "en": "source",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "合同编号",
            "en": "number",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "到账经费(万)",
            "en": "funds",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "课题状态",
            "en": "kcStatus",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"在研\",\"txt\":\"在研\"},{\"val\":\"结题\",\"txt\":\"结题\"}]"
          },
          {
            "cn": "开始时间",
            "en": "puttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "截止时间",
            "en": "endtime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          }
        ],
        [
          {
            "cn": "课题名称",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "基金名称",
            "en": "source",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "课题类型",
            "en": "typeid",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"\",\"txt\":\"---请选择---\"},{\"val\":\"重点\",\"txt\":\"重点\"},{\"val\":\"面上\",\"txt\":\"面上\"},{\"val\":\"青年\",\"txt\":\"青年\"},{\"val\":\"一般\",\"txt\":\"一般\"},\r\n{\"val\":\"自筹\",\"txt\":\"自筹\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "课题级别",
            "en": "lever",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"国家级\",\"txt\":\"国家级\",\"weight\":\"1\"},{\"val\":\"省部级\",\"txt\":\"省部级\",\"weight\":\"2\"},{\"val\":\"市厅级\",\"txt\":\"市厅级\",\"weight\":\"3\"},{\"val\":\"其他\",\"txt\":\"其他\",\"weight\":\"4\"}]"
          },
          {
            "cn": "课题编号",
            "en": "number",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "课题状态",
            "en": "kcStatus",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"在研\",\"txt\":\"在研\"},{\"val\":\"结题\",\"txt\":\"结题\"}]"
          },
          {
            "cn": "开始时间",
            "en": "puttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "截止时间",
            "en": "endtime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "到账经费(万)",
            "en": "funds",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "授予单位",
            "en": "organization",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          }
        ],
        [
          {
            "cn": "著作权名称",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "证书号",
            "en": "certificateNo",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "获得时间",
            "en": "puttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          },
          {
            "cn": "著作权类型",
            "en": "copyrightType",
            "is_table_view": "0",
            "item_type": "radio",
            "values": "[{\"val\":\"软件制品\",\"txt\":\"软件制品\",\"weight\":\"1\"},{\"val\":\"音像制品\",\"txt\":\"音像制品\",\"weight\":\"2\"}]"
          },
          {
            "cn": "著作权人",
            "en": "copyrightOwner",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "开发完成时间",
            "en": "finishTime",
            "is_table_view": "0",
            "item_type": "date",
            "values": ""
          },
          {
            "cn": "登记号",
            "en": "registerNo",
            "is_table_view": "0",
            "item_type": "text",
            "values": ""
          }
        ],
        [
          {
            "cn": "成果名称",
            "en": "title",
            "is_table_view": 0,
            "item_type": "text",
            "values": ""
          },
          {
            "cn": "本人排名",
            "en": "myRank",
            "is_table_view": "0",
            "item_type": "select",
            "values": "[{\"val\":\"1\",\"txt\":\"1\"},{\"val\":\"2\",\"txt\":\"2\"},{\"val\":\"3\",\"txt\":\"3\"},{\"val\":\"4\",\"txt\":\"4\"},{\"val\":\"5\",\"txt\":\"5\"},{\"val\":\"6\",\"txt\":\"6\"},{\"val\":\"7\",\"txt\":\"7\"},{\"val\":\"8\",\"txt\":\"8\"},{\"val\":\"9\",\"txt\":\"9\"},{\"val\":\"10\",\"txt\":\"10\"},{\"val\":\"其他\",\"txt\":\"其他\"}]"
          },
          {
            "cn": "获得时间",
            "en": "puttime",
            "is_table_view": "0",
            "item_type": "date",
            "values": "[{\"val\":\"\",\"txt\":\"不限\"},{\"val\":2006,\"txt\":\"2006年\"},{\"val\":2007,\"txt\":\"2007年\"},{\"val\":2008,\"txt\":\"2008年\"},{\"val\":2009,\"txt\":\"2009年\"},{\"val\":2010,\"txt\":\"2010年\"},{\"val\":2011,\"txt\":\"2011年\"},{\"val\":2012,\"txt\":\"2012年\"},{\"val\":2013,\"txt\":\"2013年\"},{\"val\":2014,\"txt\":\"2014年\"},{\"val\":2015,\"txt\":\"2015年\"},{\"val\":2016,\"txt\":\"2016年\"}]"
          }
        ]

      ]
    }
  },

  methods: {
    change(module, index) {
      this.headers = this.headerlist[index]
      query(0, 10, 0, module.modDbTable, this.view_order).then(res => {
        this.list = res.data.docs.records
      })
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    handleDownload() {
      if (this.multipleSelection.length) {
        this.downloadLoading = true
        import('@/vendor/Export2Excel').then(excel => {
          let tHeader = [];
          const filterVal = []
          this.headers.map(it => {
            tHeader.push(it.cn)
            filterVal.push(it.en)
          })
          // const tHeader = ['Id', 'Title', 'Author', 'Readings', 'Date']
          // const filterVal = ['id', 'title', 'author', 'pageviews', 'display_time']
          const list = this.multipleSelection
          const data = this.formatJson(filterVal, list)
          excel.export_json_to_excel({
            header: tHeader,
            data,
            filename: this.filename
          })
          this.$refs.multipleTable.clearSelection()
          this.downloadLoading = false
        })
      } else {
        this.$message({
          message: '请选择要导出的数据',
          type: 'warning'
        })
      }
    },
    formatJson(filterVal, jsonData) {
      return jsonData.map(v => filterVal.map(j => v[j]))
    }
  }
}
</script>
<style scoped>


</style>
